package com.lijiaxing.controller;

import com.lijiaxing.pojo.Result;
import com.lijiaxing.pojo.UserRes;
import com.lijiaxing.service.updateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/update")
public class updateController {
    @Autowired
    updateService us;

    @PostMapping("/user")
    public Result updateUser(Integer uid, String utel, String uname, @RequestParam("checked") Integer pid) {
        UserRes.User user = new UserRes.User();
        user.setUid(String.valueOf(uid));
        user.setUtel(utel);
        user.setUname(uname);
        user.setPid(pid);
        return us.updateUser(user);

    }
}
